#ifndef HSOUND_H_INCLUDED
#define HSOUND_H_INCLUDED

/* PlaySound(string file, bool repeat) */
int PlaySound(lua_State* l) {
	uint n = lua_gettop(l);
	const char* file;
	bool repeat = false;
	if (n >= 1 && isstr(1)) file = tostr(1); else return LOG_ERROR("PlaySound: Invalid parameters!");
	if (n == 2 && isbool(2)) repeat = tobool(2);

	P.SoundEngine->play2D(file, repeat);
	printf("Playing sound: %s\n", file);

	return 0;
}

void initSoundFuncs() {
	REG(PlaySound);
}

#endif // HSOUND_H_INCLUDED
